/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.dorian.atomicuml.models;

/**
 *
 * @author cedric.creusot
 */
public class UserInfoData {
    private String firstname;
    private String lastname;
    private String mail;
    private String password;
    private String pwd_verif;
    private boolean isLogged;

    public boolean isIsLogged() {
        return isLogged;
    }

    public void setIsLogged(boolean isLogged) {
        this.isLogged = isLogged;
    }

    public UserInfoData()
    {
        firstname = null;
        lastname = null;
        mail = null;
        password = null;
        pwd_verif = null;
        isLogged = false;
    }
    
    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public String getLastname() {
        return lastname;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    public String getMail() {
        return mail;
    }

    public void setMail(String mail) {
        this.mail = mail;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPwd_verif() {
        return pwd_verif;
    }

    public void setPwd_verif(String pwd_verif) {
        this.pwd_verif = pwd_verif;
    }
    
    public boolean isPasswordValid()
    {
        return (this.password.equals(this.pwd_verif));
    }
    
    public boolean isMailValid()
    {
        return this.mail.matches("^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)" +
                                 "*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$");
    }
}
